﻿using System;

namespace ValidationHelper.Validators
{
    public class StringMaximumLengthValidator : StringValidator
    {
        #region Propriedades
        public int MaximumLength { get; set; }
        #endregion

        #region Construtores
        public StringMaximumLengthValidator(string message, Type exceptionType, string stringToValidate, int maximumLength)
            : base(message, exceptionType, stringToValidate)
        {
            MaximumLength = maximumLength;
        }
        #endregion

        #region Métodos
        protected override bool IsNotValid()
        {
            return (!string.IsNullOrEmpty(StringToValidate) && StringToValidate.Length > MaximumLength);
        }
        #endregion
    }
}
